/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidade;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author master
 */
@Entity
@Table(name = "avaliacao_aluno")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "AvaliacaoAluno.findAll", query = "SELECT a FROM AvaliacaoAluno a"),
    @NamedQuery(name = "AvaliacaoAluno.findById", query = "SELECT a FROM AvaliacaoAluno a WHERE a.id = :id"),
    @NamedQuery(name = "AvaliacaoAluno.findByStatusEncerramento", query = "SELECT a FROM AvaliacaoAluno a WHERE a.statusEncerramento = :statusEncerramento")})
public class AvaliacaoAluno implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "id")
    private Integer id;
    @Column(name = "status_encerramento")
    private Boolean statusEncerramento;
    @JoinColumn(name = "avaliacao", referencedColumnName = "id")
    @ManyToOne
    private Avaliacao avaliacao;
    @JoinColumn(name = "aluno", referencedColumnName = "id")
    @ManyToOne
    private Aluno aluno;

    public AvaliacaoAluno() {
    }

    public AvaliacaoAluno(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Boolean getStatusEncerramento() {
        return statusEncerramento;
    }

    public void setStatusEncerramento(Boolean statusEncerramento) {
        this.statusEncerramento = statusEncerramento;
    }

    public Avaliacao getAvaliacao() {
        return avaliacao;
    }

    public void setAvaliacao(Avaliacao avaliacao) {
        this.avaliacao = avaliacao;
    }

    public Aluno getAluno() {
        return aluno;
    }

    public void setAluno(Aluno aluno) {
        this.aluno = aluno;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AvaliacaoAluno)) {
            return false;
        }
        AvaliacaoAluno other = (AvaliacaoAluno) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidade.AvaliacaoAluno[ id=" + id + " ]";
    }
    
}
